//
//  TYZImageTitleButton.h
//  DriveSchoolCoach
//
//  Created by TangBin on 2019/8/13.
//  Copyright © 2019 TangBin. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

// 定义一个枚举（包含了四种类型的button）
typedef NS_ENUM(NSUInteger, TYZButtonEdgeInsetsStyle)
{
    TYZButtonEdgeInsetsStyleTop = 0,    ///< image在上，label在下
    TYZButtonEdgeInsetsStyleLeft,       ///< image在左，label在右
    TYZButtonEdgeInsetsStyleBottom,     ///< image在下，label在上
    TYZButtonEdgeInsetsStyleRight       ///< image在右，label在左
};

/**
 同时有图片 文字
 */
@interface TYZImageTitleButton : UIButton

+ (TYZImageTitleButton *)createWithImageButton:(nullable UIView *)superView frame:(CGRect)frame font:(nullable UIFont *)font action:(nullable SEL)action propertiesBlock:(void(^)(TYZImageTitleButton *button))block;

+ (TYZImageTitleButton *)createWithImageButton:(nullable UIView *)superView frame:(CGRect)frame font:(nullable UIFont *)font target:(nullable id)target action:(nullable SEL)action propertiesBlock:(void(^)(TYZImageTitleButton *button))block;


/**
 *  设置button的titleLabel和imageView的布局样式，及间距
 *
 *  @param style titleLabel和imageView的布局样式
 *  @param space titleLabel和imageView的间距
 */
- (void)layoutButtonWithEdgeInsetsStyle:(TYZButtonEdgeInsetsStyle)style imageTitleSpace:(CGFloat)space;

@end

NS_ASSUME_NONNULL_END
